3.1.38 \(\int \frac {\cos (a+\frac {b}{x})}{x^3} \, dx\) [38]

Optimal. Leaf size=30 \[ -\frac {\cos \left (a+\frac {b}{x}\right )}{b^2}-\frac {\sin \left (a+\frac {b}{x}\right )}{b x} \]

[Out]

-cos(a+b/x)/b^2-sin(a+b/x)/b/x

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3461, 3377, 2718} \begin {gather*} -\frac {\cos \left (a+\frac {b}{x}\right )}{b^2}-\frac {\sin \left (a+\frac {b}{x}\right )}{b x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[a + b/x]/x^3,x]

[Out]

-(Cos[a + b/x]/b^2) - Sin[a + b/x]/(b*x)

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3461

Int[((a_.) + Cos[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Cos[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rubi steps

\begin {align*} \int \frac {\cos \left (a+\frac {b}{x}\right )}{x^3} \, dx &=-\text {Subst}\left (\int x \cos (a+b x) \, dx,x,\frac {1}{x}\right )\\ &=-\frac {\sin \left (a+\frac {b}{x}\right )}{b x}+\frac {\text {Subst}\left (\int \sin (a+b x) \, dx,x,\frac {1}{x}\right )}{b}\\ &=-\frac {\cos \left (a+\frac {b}{x}\right )}{b^2}-\frac {\sin \left (a+\frac {b}{x}\right )}{b x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 29, normalized size = 0.97 \begin {gather*} -\frac {x \cos \left (a+\frac {b}{x}\right )+b \sin \left (a+\frac {b}{x}\right )}{b^2 x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b/x]/x^3,x]

[Out]

-((x*Cos[a + b/x] + b*Sin[a + b/x])/(b^2*x))

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 42, normalized size = 1.40

method result size
risch \(-\frac {\cos \left (\frac {a x +b}{x}\right )}{b^{2}}-\frac {\sin \left (\frac {a x +b}{x}\right )}{b x}\) \(35\)
derivativedivides \(-\frac {\cos \left (a +\frac {b}{x}\right )+\left (a +\frac {b}{x}\right ) \sin \left (a +\frac {b}{x}\right )-a \sin \left (a +\frac {b}{x}\right )}{b^{2}}\) \(42\)
default \(-\frac {\cos \left (a +\frac {b}{x}\right )+\left (a +\frac {b}{x}\right ) \sin \left (a +\frac {b}{x}\right )-a \sin \left (a +\frac {b}{x}\right )}{b^{2}}\) \(42\)
norman \(\frac {\frac {2 x^{2} \left (\tan ^{2}\left (\frac {a}{2}+\frac {b}{2 x}\right )\right )}{b^{2}}-\frac {2 x \tan \left (\frac {a}{2}+\frac {b}{2 x}\right )}{b}}{\left (1+\tan ^{2}\left (\frac {a}{2}+\frac {b}{2 x}\right )\right ) x^{2}}\) \(61\)
meijerg \(-\frac {2 \sqrt {\pi }\, \cos \left (a \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (\frac {b}{x}\right )}{2 \sqrt {\pi }}+\frac {b \sin \left (\frac {b}{x}\right )}{2 \sqrt {\pi }\, x}\right )}{b^{2}}+\frac {2 \sqrt {\pi }\, \sin \left (a \right ) \left (-\frac {b \cos \left (\frac {b}{x}\right )}{2 \sqrt {\pi }\, x}+\frac {\sin \left (\frac {b}{x}\right )}{2 \sqrt {\pi }}\right )}{b^{2}}\) \(81\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+b/x)/x^3,x,method=_RETURNVERBOSE)

[Out]

-1/b^2*(cos(a+b/x)+(a+b/x)*sin(a+b/x)-a*sin(a+b/x))

________________________________________________________________________________________

Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 0.32, size = 51, normalized size = 1.70 \begin {gather*} -\frac {{\left (\Gamma \left (2, \frac {i \, b}{x}\right ) + \Gamma \left (2, -\frac {i \, b}{x}\right )\right )} \cos \left (a\right ) - {\left (i \, \Gamma \left (2, \frac {i \, b}{x}\right ) - i \, \Gamma \left (2, -\frac {i \, b}{x}\right )\right )} \sin \left (a\right )}{2 \, b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^3,x, algorithm="maxima")

[Out]

-1/2*((gamma(2, I*b/x) + gamma(2, -I*b/x))*cos(a) - (I*gamma(2, I*b/x) - I*gamma(2, -I*b/x))*sin(a))/b^2

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 33, normalized size = 1.10 \begin {gather*} -\frac {x \cos \left (\frac {a x + b}{x}\right ) + b \sin \left (\frac {a x + b}{x}\right )}{b^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^3,x, algorithm="fricas")

[Out]

-(x*cos((a*x + b)/x) + b*sin((a*x + b)/x))/(b^2*x)

________________________________________________________________________________________

Sympy [A]
time = 0.47, size = 31, normalized size = 1.03 \begin {gather*} \begin {cases} - \frac {\sin {\left (a + \frac {b}{x} \right )}}{b x} - \frac {\cos {\left (a + \frac {b}{x} \right )}}{b^{2}} & \text {for}\: b \neq 0 \\- \frac {\cos {\left (a \right )}}{2 x^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x**3,x)

[Out]

Piecewise((-sin(a + b/x)/(b*x) - cos(a + b/x)/b**2, Ne(b, 0)), (-cos(a)/(2*x**2), True))

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 49, normalized size = 1.63 \begin {gather*} \frac {a \sin \left (\frac {a x + b}{x}\right ) - \frac {{\left (a x + b\right )} \sin \left (\frac {a x + b}{x}\right )}{x} - \cos \left (\frac {a x + b}{x}\right )}{b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^3,x, algorithm="giac")

[Out]

(a*sin((a*x + b)/x) - (a*x + b)*sin((a*x + b)/x)/x - cos((a*x + b)/x))/b^2

________________________________________________________________________________________

Mupad [B]
time = 0.28, size = 30, normalized size = 1.00 \begin {gather*} -\frac {\cos \left (a+\frac {b}{x}\right )}{b^2}-\frac {\sin \left (a+\frac {b}{x}\right )}{b\,x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b/x)/x^3,x)

[Out]

- cos(a + b/x)/b^2 - sin(a + b/x)/(b*x)

________________________________________________________________________________________